Skip to content

[SYCL][test] Add --sysroot=%S/Inputs/SYCL to spir/spirv target RUN lines in clang-linker-wrapper test#22049

Open
srividya-sundaram wants to merge 1 commit into
intel:syclfrom
srividya-sundaram:fix-clw-test
Open

[SYCL][test] Add --sysroot=%S/Inputs/SYCL to spir/spirv target RUN lines in clang-linker-wrapper test#22049
srividya-sundaram wants to merge 1 commit into
intel:syclfrom
srividya-sundaram:fix-clw-test

Conversation

@srividya-sundaram
Copy link
Copy Markdown
Contributor

@srividya-sundaram srividya-sundaram commented May 19, 2026

After PR #21672, SYCL device libraries are linked at compile time when using --offload-new-driver with SPIR/SPIRV targets. The compile RUN lines in clang-linker-wrapper.cpp that use SPIR-based targets now require the device libraries to be resolvable on disk.

In environments where the device libraries are not installed alongside the compiler (e.g. MSan self builds), these RUN lines fail with "cannot find expected SYCL device library" errors.

Fix by adding --sysroot=%S/Inputs/SYCL to the affected compile RUN lines so the stub .bc files in the test inputs directory are used for path resolution. This is sufficient since these are driver tests that check command line arguments, not actual compilation output.

@srividya-sundaram
Copy link
Copy Markdown
Contributor Author

Test failures in pre-commit testing are unrelated to this PR.

@srividya-sundaram srividya-sundaram marked this pull request as ready for review May 19, 2026 18:44
@srividya-sundaram srividya-sundaram requested a review from a team as a code owner May 19, 2026 18:44
@mdtoguchi
Copy link
Copy Markdown
Contributor

Can you update to head? My previous PR that updated this test added the REQUIRES: libdevice to the top of the file. With these --sysroot changes, the libdevice requirement shouldn't be needed anymore.

@mdtoguchi
Copy link
Copy Markdown
Contributor

mdtoguchi commented May 19, 2026

Can you update to head? My previous PR that updated this test added the REQUIRES: libdevice to the top of the file. With these --sysroot changes, the libdevice requirement shouldn't be needed anymore.

Nevermind - this won't work. Due to the stub .bc files being empty, the linking from within the device compilation step will fail:
.---command stderr------------
| fatal error: cannot open file '/localdisk2/mtoguchi/github/llvm/clang/test/Driver/Inputs/SYCL/lib/libsycl-crt.bc': file too small to contain bitcode header
| 1 error generated.
`-----------------------------
error: command failed with exit status: 1

@srividya-sundaram
Copy link
Copy Markdown
Contributor Author

Can you update to head? My previous PR that updated this test added the REQUIRES: libdevice to the top of the file. With these --sysroot changes, the libdevice requirement shouldn't be needed anymore.

Nevermind - this won't work. Due to the stub .bc files being empty, the linking from within the device compilation step will fail: .---command stderr------------ | fatal error: cannot open file '/localdisk2/mtoguchi/github/llvm/clang/test/Driver/Inputs/SYCL/lib/libsycl-crt.bc': file too small to contain bitcode header | 1 error generated. `----------------------------- error: command failed with exit status: 1

@mdtoguchi Are there any other changes needed for this PR?

@mdtoguchi
Copy link
Copy Markdown
Contributor

Can you update to head? My previous PR that updated this test added the REQUIRES: libdevice to the top of the file. With these --sysroot changes, the libdevice requirement shouldn't be needed anymore.

Nevermind - this won't work. Due to the stub .bc files being empty, the linking from within the device compilation step will fail: .---command stderr------------ | fatal error: cannot open file '/localdisk2/mtoguchi/github/llvm/clang/test/Driver/Inputs/SYCL/lib/libsycl-crt.bc': file too small to contain bitcode header | 1 error generated. `----------------------------- error: command failed with exit status: 1

@mdtoguchi Are there any other changes needed for this PR?

No - this can be abandoned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants